package cn.heycm.blog.api.console.login;

import cn.heycm.blog.api.console.login.cmd.LoginCmd;
import cn.heycm.blog.api.console.login.cmd.SendVerifyCodeCmd;
import cn.heycm.blog.api.console.login.vo.SessionVO;
import cn.heycm.blog.common.entity.constant.Constant;
import cn.heycm.blog.common.entity.result.Result;
import jakarta.validation.Valid;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;

/**
 * 管理员登录认证
 *
 * @author hey
 * @version 1.0
 * @since 2024/9/15 17:20
 */
@RequestMapping(Constant.API_CONSOLE + "/adminLogin")
public interface AdminLoginApi {

    @PostMapping("/sendVerifyCode")
    Result<Object> sendVerifyCode(@RequestBody @Valid SendVerifyCodeCmd cmd);

    @PostMapping("/login")
    Result<SessionVO> login(@RequestBody @Valid LoginCmd cmd);
}
